import {getNode} from "../bpmnUtil";

function propProvider(eventBus, bpmnFactory, elementRegistry, elementTemplates, translate) {


  // console.log(eventBus);

  // PropertiesActivator.call(this, eventBus);
  //
  // this.getTabs = function(element) {
  //
  //   console.log(getNode(element));
  //
  //   var generalTab = {
  //     id: 'general',
  //     label: translate('General'),
  //     groups: createGeneralTabGroups(element, bpmnFactory, elementRegistry, elementTemplates, translate)
  //   };
  //
  //   // // 拓展选项卡
  //   // var extensionsTab = {
  //   //   id: 'extensionElements',
  //   //   label: translate('Extensions'),
  //   //   groups: createExtensionElementsGroups(element, bpmnFactory, elementRegistry, translate)
  //   // };
  //
  //   var cjcPropTab = {
  //     id: 'cjcTabs',
  //     label: translate('cjcTabs'),
  //     groups: createCjcTabsGroups(element, bpmnFactory, elementRegistry, translate)
  //   }
  //
  //   // Show general + "cjc" tab
  //   return [generalTab, cjcPropTab];
  // }

  eventBus.on("selection.changed", selection => {



    console.log(eventBus);

    // console.log(selection);
    const {newSelection, oldSelection} = selection;

    if (newSelection) {

      for (const sel of newSelection) {


        const node = getNode(sel);

        node.onActive(sel,bpmnFactory);

        console.log('node');
        console.log(node);

      }

    }
  });
}

propProvider.$inject = ['eventBus', 'bpmnFactory', 'elementRegistry', 'elementTemplates', 'translate'];
// inherits(cjcPropertiesProvider, PropertiesActivator);
export default propProvider;